home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_bug.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  96 lines

  1. # Jones 3D Cog Script
  2. #
  3. # actor_Bug.cog
  4. #
  5. # [RT]
  6. #
  7. # Animates cute little bug legs.
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15.     message        created
  16.     message        aievent
  17.     message        killed
  18.    
  19. # ************************** TEMPLATES *************************
  20.     material    legs=cbleg4.mat                local
  21.  
  22.     model        liveBug=gen_cb.3do            local
  23.     model        deadBug=gen_cb_dead.3do        local
  24.  
  25. # ************************** MISC LOCAL VARS *******************
  26.     thing        bug                            local
  27.  
  28.     int            newMode                        local
  29.     int            oldMode                        local
  30.  
  31. end
  32.  
  33. # ===================================================================
  34. code
  35.  
  36. # -------------------------------------------------------------------
  37. created:
  38.  
  39.     bug = GetSenderRef();
  40.  
  41.     SetThingModel(bug, deadBug);
  42.     MaterialAnim(legs, 8.0, 0x1);
  43.  
  44.     return;
  45.  
  46.  
  47. # -------------------------------------------------------------------
  48. aievent:
  49.  
  50.     bug = GetSenderRef();
  51.  
  52.     # See if the mode has changed
  53.     if (BITTEST(GetParam(0), 0x100))
  54.     {
  55.         newMode = GetParam(1);
  56.         oldMode = GetParam(2);
  57.  
  58.         # See if he just started moving
  59.         if ((BITTEST(newMode, 0x1)) && (!BITTEST(oldMode, 0x1)))
  60.         {
  61.             PlaySoundClass(bug, RandBetween(6,7));                            # play 'walk' sound
  62.  
  63.             if (GetThingModel(bug) != liveBug)
  64.                 SetThingModel(bug, liveBug);
  65.         }
  66.     }
  67.     # See if he just stopped
  68.     else if (BITTEST(GetParam(0), 0x800))
  69.     {
  70.         StopSoundClass(bug, 6);
  71.         StopSoundClass(bug, 7);
  72.  
  73.            if (GetThingModel(bug) != deadBug)
  74.         {
  75.             SetThingModel(bug, deadBug);
  76.         }
  77.     }
  78.  
  79.     return;
  80.  
  81.  
  82. # -------------------------------------------------------------------
  83. killed:
  84.  
  85.     bug = GetSenderRef();
  86.  
  87.     if (GetThingModel(bug) != deadBug)
  88.     {
  89.         SetThingModel(bug, deadBug);
  90.     }
  91.  
  92.     return;
  93.  
  94. end
  95.  
  96.